package com.tbit.manager.api;

import com.tbit.manager.api.dto.PackageDelayDTO;
import com.tbit.manager.api.dto.UserMemberDTO;
import com.tbit.manager.enums.ApiConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * 会员卡
 *
 * @author ：zhangtianyou
 * @since 2024/11/22
 */
@FeignClient(name = ApiConstants.NAME)
public interface VipCardApi {

    String PREFIX = ApiConstants.PREFIX + "/vipCard";
    /**
     * 用户购买记录
     */
    @GetMapping(PREFIX + "/userVipPage")
    List<UserMemberDTO> userVipPage(@RequestParam(value = "accountId",required = false) Integer accountId,
                                    @RequestParam("userId") Integer userId,
                                    @RequestParam(value ="phone",required = false) String phone,
                                    @RequestParam(value = "pageNumber", defaultValue = "1") Integer pageNumber,
                                    @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                    @RequestParam(value ="startTime",required = false) Date startTime,
                                    @RequestParam(value ="endTime",required = false) Date endTime);

    /**
     * 延长会员卡到期时间
     *
     * @param delayDTO .
     * @return .
     */
    @PostMapping(value = PREFIX + "/modifyExpireTime",consumes = "application/json",produces = "application/json")
    String modifyVipCardExpireTime(@RequestBody PackageDelayDTO delayDTO);
}
